<?php
/**
 * @link http://www.yiiframework.com/
 * @copyright Copyright (c) 2008 Yii Software LLC
 * @license http://www.yiiframework.com/license/
 */

namespace zhtfrontend\assets;

use yii\web\AssetBundle;

/**
 * @author Qiang Xue <qiang.xue@gmail.com>
 * @since 2.0
 */
class AppAsset extends AssetBundle
{

    public $tree=false;
    public $table=true;
    public $version = '2016120111';

    public $basePath = '@webroot';
    public $baseUrl = '@web';
    public $css = [
        'css/bootstrap.min.css',
        'css/site.css',
        'css/font-awesome.css',
        'css/tablesaw.css',
        'css/jquery.datetimepicker.css',
        'css/demo.css',
        'css/jqbar.css',
        'css/css.css',
    ];
    public $js = [
        "scripts/bootstrap.min.js",
        "scripts/wysihtml5-0.3.0.js",
        "scripts/tablesaw.js",
        "scripts/tablesaw-init.js",
        "scripts/jquery.datetimepicker.full.js",
        'scripts/index.number.js',
        'scripts/echarts.min.js',
        'scripts/jquery.slimscroll.min.js',
        "scripts/jqbar.js",
        "scripts/js.js",
        "scripts/jquery.jqprint-0.3.js",

       // "scripts/demo.js",
    ];
    public $depends = [
        'yii\web\YiiAsset',
    ];

    public function registerAssetFiles($view)
    {
        if($this->tree){
            $js = [
                "scripts/bootstrap.min.js",
                'scripts/jquery.treetable.js',
                'scripts/jquery.onoff.js',
                'scripts/jquery.slimscroll.min.js',
                "scripts/js.js",
            ];
            $this->js=$js;
            $css=[
                'css/bootstrap.min.css',
                'css/font-awesome.css',
                'css/uniform.css',
                'css/screen.css',
                'css/jquery.treetable.css',
                'css/jquery.treetable.theme.default.css',
                'css/jquery.onoff.css',
                'css/css.css',
            ];
            $this->css=$css;
        }
        foreach($this->js as $k=>$j){
            $this->js[$k] = $j.'?v='.$this->version;
        }
        parent::registerAssetFiles($view);
    }
}
